package com.clarencezero.mylover.param;

public class Result {
    private int code;  // 状态码
    private String msg;
    private Object data;

    public Result() {}
    public Result(int code) {
        this.code = code;
    }

    public Result(int code, String msg) {
        this.msg = msg;
        this.code = code;
    }

    public Result(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public void success() {
        this.code = 200;
    }
    public void success(String msg) {
        this.code = 200;
        this.msg = msg;
    }

    public  void success(String msg, Object data) {
        this.code = 200;
        this.msg = msg;
        this.data = data;
    }

    public void failure() {
        this.code = 400;
    }

    public void failure(String msg) {
        this.msg = msg;
    }

    public void failure(String msg, Object data) {
        this.data = data;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
